﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using  System.Data;
using Team4Mock.DAO;

namespace Team4Mock.Entity
{
    public class OrganisationEntity
    {
        OrganisationDAO od=new OrganisationDAO();
        private int organizationid;
        private int refid;
        private string organizationName;
        private string organizationShortDescription;
        private int leadContact;
        private string addressLine1;
        private string addressLine2;
        private string addressLine3;
        private string postCode;
        private int preferredOrganization;
        private int expressionOfOrganization;
        private string typeOfBusiness;
        private string sICCode;
        private string town;
        private string county;
        private string country;
        private string orFullDescription;
        private string phoneNumber;
        private string fax;
        private string webAddress;
        private string chartyNumber;
        private string companyNumber;
        private string key;
        private int isactive;
        public int Organizationid
        {
            get { return this.organizationid; }
            set { this.organizationid = value; }
        }
        public int Refid
        {
            get { return this.refid; }
            set { this.refid = value; }
        }
        public OrganisationEntity()
        { }
        public OrganisationEntity(string organizationName, string organizationShortDescription, int leadContact, string addressLine1, string addressLine2, string addressLine3, string postCode, int preferredOrganization, int expressionOfOrganization, string typeOfBusiness, string sICCode, string orFullDescription, string phoneNumber, string fax, string webAddress, string chartyNumber, string companyNumber)
        {
            this.organizationName = organizationName;
            this.organizationShortDescription = organizationShortDescription;
            this.leadContact = leadContact;
            this.addressLine1 = addressLine1;
            this.addressLine2 = addressLine2;
            this.addressLine3 = addressLine3;
            this.postCode = postCode;
            this.preferredOrganization = preferredOrganization;
            this.expressionOfOrganization = expressionOfOrganization;
            this.typeOfBusiness = typeOfBusiness;
            this.sICCode = sICCode;
            this.orFullDescription = orFullDescription;
            this.phoneNumber = phoneNumber;
            this.fax = fax;
            this.webAddress = webAddress;
            this.chartyNumber = chartyNumber;
            this.companyNumber = companyNumber;
        }

        public string Key { get; set; }

        public string OrganizationName
        {
            get { return this.organizationName; }
            set { this.organizationName = value; }
        }

        public string OrganizationShortDescription
        {
            get { return this.organizationShortDescription; }
            set
            {
                if (value == null)
                    throw new Exception("organizationShortDescription not allow nullvalue.");
                this.organizationShortDescription = value;
            }
        }
        public int LeadContact
        {
            get { return this.leadContact; }
            set { this.leadContact = value; }
        }
        public int IsActive
        {
            get { return this.isactive; }
            set { this.isactive = value; }
        }
        public string Town
        {
            get { return this.town; }
            set { this.town = value; }
        }
        public string Country
        {
            get { return this.country; }
            set { this.country = value; }
        }
        public string County
        {
            get { return this.county; }
            set { this.county = value; }
        }
        public string AddressLine1
        {
            get { return this.addressLine1; }
            set
            {
                if (value == null)
                    throw new Exception("addressLine1 not allow nullvalue.");
                this.addressLine1 = value;
            }
        }
        public string AddressLine2
        {
            get { return this.addressLine2; }
            set { this.addressLine2 = value; }
        }
        public string AddressLine3
        {
            get { return this.addressLine3; }
            set { this.addressLine3 = value; }
        }
        public string PostCode
        {
            get { return this.postCode; }
            set
            {
                if (value == null)
                    throw new Exception("postCode not allow nullvalue.");
                this.postCode = value;
            }
        }
        public int PreferredOrganization
        {
            get { return this.preferredOrganization; }
            set { this.preferredOrganization = value; }
        }
        public int ExpressionOfOrganization
        {
            get { return this.expressionOfOrganization; }
            set { this.expressionOfOrganization = value; }
        }
        public string TypeOfBusiness
        {
            get { return this.typeOfBusiness; }
            set { this.typeOfBusiness = value; }
        }
        public string SICCode
        {
            get { return this.sICCode; }
            set { this.sICCode = value; }
        }
        public string OrFullDescription
        {
            get { return this.orFullDescription; }
            set { this.orFullDescription = value; }
        }
        public string PhoneNumber
        {
            get { return this.phoneNumber; }
            set
            {
                if (value == null)
                    throw new Exception("phoneNumber not allow nullvalue.");
                this.phoneNumber = value;
            }
        }
        public string Fax
        {
            get { return this.fax; }
            set { this.fax = value; }
        }
        public string WebAddress
        {
            get { return this.webAddress; }
            set { this.webAddress = value; }
        }
        public string ChartyNumber
        {
            get { return this.chartyNumber; }
            set { this.chartyNumber = value; }
        }
        public string CompanyNumber
        {
            get { return this.companyNumber; }
            set { this.companyNumber = value; }
        }
        public DataTable Getdata()
        {
            return od.Getdata();
        }
        public DataTable GetdataTrue()
        {
            return od.GetdataTrue();
        }
        public DataTable GetCountry()
        {
            return od.GetCountry();
        }
        public DataTable Search(OrganisationEntity e)
        {
            return od.Search(e.Key);
        }
        public DataTable SearchTrue(OrganisationEntity e)
        {
            return od.SearchTrue(e.Key);
        }
        public DataTable GetOrgSpec()
        {
            return od.GetOrgSpec();
        }
        public DataTable GetAccred()
        {
            return od.GetAccred();
        }
        public DataTable GetOEOIPro()
        {
            return od.GetOEOIPro();
        }
        public DataTable GetOEOISer()
        {
            return od.GetOEOISer();
        }
        public DataTable GetEthicCapa()
        {
            return od.GetEthicCapa();
        }
        public void Del(OrganisationEntity e)
        {
            od.Del(e.Organizationid);
        }

        public DataTable GetSerBarrieCapa()
        {
            return od.GetSerBarrieCapa();
        }
        public DataTable GetSerBenifitCapa()
        {
            return od.GetSerBenifitCapa();
        }
        public DataTable GetSerDisaCapa()
        {
            return od.GetSerDisaCapa();
        }
        public DataTable GetSerPersoCapa()
        {
            return od.GetSerPersoCapa();
        }
        public void Insert(OrganisationEntity e)
        { 
            od.InsertOrg(e.OrganizationName,e.OrganizationShortDescription,e.LeadContact,e.AddressLine1,e.AddressLine2,e.AddressLine3,e.PostCode,e.Town,e.County,e.Country,e.PreferredOrganization,e.ExpressionOfOrganization,e.TypeOfBusiness,e.SICCode,e.OrFullDescription,e.PhoneNumber,e.Fax,e.WebAddress,e.ChartyNumber,e.CompanyNumber,e.IsActive);
        }
        public void Update(OrganisationEntity e)
        {
            od.UpdateOrg(e.OrganizationName, e.OrganizationShortDescription, e.LeadContact, e.AddressLine1, e.AddressLine2, e.AddressLine3, e.PostCode, e.Town, e.County, e.Country, e.PreferredOrganization, e.ExpressionOfOrganization, e.TypeOfBusiness, e.SICCode, e.OrFullDescription, e.PhoneNumber, e.Fax, e.WebAddress, e.ChartyNumber, e.CompanyNumber, e.IsActive,e.Organizationid);
        }
        public int GetID()
        {
            return od.Getid();
        }
        public void DelAcc(OrganisationEntity e)
        {
            od.DelAcc(e.Organizationid);
        }
        public void DelOEOIPro(OrganisationEntity e)
        {
            od.DelOEOIPro(e.Organizationid);
        }
        public void DelOEOISer(OrganisationEntity e)
        {
            od.DelOEOISer(e.Organizationid);
        }
        public void DelBarrier(OrganisationEntity e)
        {
            od.DelBarrier(e.Organizationid);
        }
        public void DelBenefit(OrganisationEntity e)
        {
            od.DelBenefit(e.Organizationid);
        }
        public void DelDisa(OrganisationEntity e)
        {
            od.DelDisa(e.Organizationid);
        }
        public void DelEthnic(OrganisationEntity e)
        {
            od.DelEthnic(e.Organizationid);
        }
        public void DelPerso(OrganisationEntity e)
        {
            od.DelPerso(e.Organizationid);
        }
        public void DelSpec(OrganisationEntity e)
        {
            od.DelSpec(e.Organizationid);
        }
        //
        public void InsertAcc(OrganisationEntity e)
        {
            od.InsertAcc(e.Organizationid, e.Refid);
        }
        public void InsertBarrier(OrganisationEntity e)
        {
            od.InsertBarrier(e.Organizationid, e.Refid);
        }
        public void InsertBenefit(OrganisationEntity e)
        {
            od.InsertBenefit(e.Organizationid, e.Refid);
        }
        public void InsertDisa(OrganisationEntity e)
        {
            od.InsertDisa(e.Organizationid, e.Refid);
        }
        public void InsertEthnic(OrganisationEntity e)
        {
            od.InsertEthnic(e.Organizationid, e.Refid);
        }
        public void InsertPerso(OrganisationEntity e)
        {
            od.InsertPerso(e.Organizationid, e.Refid);
        }
        public void InsertSpec(OrganisationEntity e)
        {
            od.InsertSpec(e.Organizationid, e.Refid);
        }
        public void InsertOEOIPro(OrganisationEntity e)
        {
            od.InsertOEOIPro(e.Organizationid, e.Refid);
        }
        public void InsertOEOISer(OrganisationEntity e)
        {
            od.InsertOEOISer(e.Organizationid, e.Refid);
        }
        //
        public DataTable GetDataById(OrganisationEntity e)
        {
            return od.GetdataById(e.Organizationid);
        }
        public DataTable GetAccById(OrganisationEntity e)
        {
            return od.GetAccById(e.Organizationid);
        }
        public DataTable GetOEOIProById(OrganisationEntity e)
        {
            return od.GetOEOIProById(e.Organizationid);
        }
        public DataTable GetOEOISerById(OrganisationEntity e)
        {
            return od.GetOEOISerById(e.Organizationid);
        }
        public DataTable GetBarriersById(OrganisationEntity e)
        {
            return od.GetBarriersById(e.Organizationid);
        }
        public DataTable GetBenefitById(OrganisationEntity e)
        {
            return od.GetBenefitById(e.Organizationid);
        }
        public DataTable GetDisaById(OrganisationEntity e)
        {
            return od.GetDisaById(e.Organizationid);
        }
        public DataTable GetEthnicById(OrganisationEntity e)
        {
            return od.GetEthnicById(e.Organizationid);
        }
        public DataTable GetPersoById(OrganisationEntity e)
        {
            return od.GetPersoById(e.Organizationid);
        }
        public DataTable GetSpecById(OrganisationEntity e)
        {
            return od.GetSpecById(e.Organizationid);
        }
        public bool CheckName(OrganisationEntity e)
        {
            return od.CheckName(e.OrganizationName);
        }
    }
}